package com.tanhua.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tanhua.model.domain.mysql.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserInfoMapper extends BaseMapper<UserInfo> {

    /**
     * description: 黑名单查询 <br>
     * version: 1.0 <br>
     * date: 2021/11/14 21:17 <br>
     * author: SangWu <br>
     *
     * @param userId
 * @param blackListPage
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.tanhua.model.domain.mysql.UserInfo>
     */

    @Select("select * from tb_user_info where id in (\n" +
            "  SELECT black_user_id FROM tb_black_list where user_id=#{userId}\n" +
            ")")
    IPage<UserInfo> findBlacklist(@Param("userId") Long userId, @Param("pages") IPage blackListPage);
}